package com.woniu.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.woniu.entity.Client;
import com.woniu.entity.PaidOrderEntity;
import com.woniu.entity.UserInfoEntity;
import com.woniu.service.PaidOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import static com.ruoyi.common.utils.PageUtils.startPage;

@RestController
@RequestMapping("/paidOrder")
public class PaidOrderController extends BaseController {
    @Autowired
    PaidOrderService paidOrderService;

    @GetMapping("/list")
    public TableDataInfo list(PaidOrderEntity paidOrderEntity) {
        System.out.println("paidOrderEntity:"+paidOrderEntity.toString());
        startPage();

        return getDataTable(paidOrderService.listPaidOrder(paidOrderEntity)) ;
    }
    @GetMapping("/{paidOrderId}")
    public AjaxResult findPaidOrderById(@PathVariable Integer paidOrderId) {
      return  AjaxResult.success(paidOrderService.findPaidOrderById(paidOrderId));
    }
}
